<template>
	<view class="evaluate-page">
		<view class="courses-info" v-if="coursesDetail">
			<image :src="coursesDetail.course_image" class="item-left"></image>
			<view class="item-right">
				<view class="item-title">{{coursesDetail.course_name}}</view>
				<view class="item-time">授课老师:{{coursesDetail.teacher_name}}</view>
				<view class="item-price"><text class="unit">￥</text> {{coursesDetail.price}}</view>
			</view>
		</view>
		<view class="evaluate-content">
			<view class="evaluate-top">
				<view class="left">评价时间</view>
				<view class="right">{{coursesDetail.createtime}}</view>
			</view>
			<view class="evaluate-center">
				<view class="left">
					<view class="tag">老师评分</view>
					<u-rate :value="coursesDetail.teacher" readonly activeColor="#FDAC2D"
						inactiveColor="#D8D8D8"></u-rate>
				</view>
				<view class="right">
					<view class="tag">课程评分</view>
					<u-rate :value="coursesDetail.course" readonly activeColor="#FDAC2D"
						inactiveColor="#D8D8D8"></u-rate>
				</view>
			</view>
			<view class="evaluate-bottom">{{coursesDetail.content}}</view>
			<view class="evaluate-images" v-if="coursesDetail.images">
				<u-album :urls="coursesDetail.images" multipleSize="110" maxCount="3"></u-album>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pre_id: null, //订单ID
				coursesDetail: null, //课程信息
			}
		},
		onLoad(options) {
			if (options && options.pre_id) {
				this.pre_id = options.pre_id
				this.courseCommentDetail()
			}
		},
		methods: {
			courseCommentDetail() {
				this.$Api.courses.courseCommentDetail({
					pre_id: this.pre_id,
				}).then(res => {
					this.coursesDetail = res.data
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.evaluate-page {
		width: 100%;
		min-height: 100vh;
		background: #F6F6F8;

		.courses-info {
			padding: 20rpx;
			display: flex;
			align-items: center;
			background: #ffffff;

			.item-left {
				width: 156rpx;
				height: 156rpx;
				margin-right: 26rpx;
			}

			.item-right {
				flex: 1;
				height: 156rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.item-title {
					font-weight: bold;
					font-size: 32rpx;
				}

				.item-time {
					font-size: 26rpx;
					color: #565656;
					margin-top: 6rpx;
				}

				.item-price {
					font-weight: bold;
					font-size: 40rpx;
					color: #FD463E;
					margin-top: 16rpx;

					.unit {
						font-size: 28rpx;
					}
				}
			}
		}



		.evaluate-content {
			margin-top: 20rpx;
			padding: 20rpx;
			background-color: #ffffff;


			.evaluate-top {
				display: flex;
				align-items: center;

				.left {
					font-size: 28rpx;
					font-weight: bold;
					margin-right: 20rpx;
				}

				.right {
					font-size: 26rpx;
					color: #999CA7;
				}
			}

			.evaluate-center {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 20rpx 0;

				.left {
					display: flex;
					align-items: center;

					.tag {
						padding: 8rpx 10rpx;
						background: #fff8e5;
						border-radius: 6rpx;
						font-size: 24rpx;
						color: #FDAC2D;
					}
				}

				.right {
					display: flex;
					align-items: center;

					.tag {
						padding: 8rpx 10rpx;
						background: #edf4d0;
						border-radius: 6rpx;
						font-size: 24rpx;
						color: #A3C616;
					}
				}
			}

			.evaluate-bottom {
				font-size: 26rpx;
				color: #999CA7;
				line-height: 48rpx;
				padding-bottom: 20rpx;
			}

			.evaluate-images {
				padding-bottom: 20rpx;
			}
		}
	}
</style>